package com.airnews.ticket.ui.flight;

import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

import com.airnews.ticket.R;
import com.airnews.ticket.ui.BaseActivity;

/**
 * 航班列表
 * 
 */
public class FlightList extends BaseActivity implements OnClickListener {

	private ListView flight_list;
	private Button button_prev_day, button_select_date, button_next_day;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.flight_list_layout);
		super.onCreate(savedInstanceState);

		setTitleBar(R.string.title_filght_list);
		setupView();
		
		new QueryFightTask().execute();
	}

	private void setupView() {
		flight_list = (ListView) findViewById(R.id.flight_list);
		
		button_prev_day = (Button) findViewById(R.id.button_prev_day);
		button_next_day = (Button) findViewById(R.id.button_next_day);
		button_select_date = (Button) findViewById(R.id.button_select_date);
		button_prev_day.setOnClickListener(this);
		button_next_day.setOnClickListener(this);
		button_select_date.setOnClickListener(this);

		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.button_prev_day: {
				/*btn_right.setBackgroundResource(R.drawable.tab_button_bg_left);
				btn_left.setBackgroundResource(R.drawable.tab_button_left_selected);
				departure_date.setBackgroundResource(R.drawable.shape_background_state);
				date_split_line.setVisibility(View.GONE);
				back_date.setVisibility(View.GONE);*/
				break;
			}
			case R.id.button_next_day: {
				/*btn_left.setBackgroundResource(R.drawable.tab_button_bg_left);
				btn_right.setBackgroundResource(R.drawable.tab_button_right_selected);
				departure_date.setBackgroundResource(R.drawable.shape_background_state_top);
				date_split_line.setVisibility(View.VISIBLE);
				back_date.setVisibility(View.VISIBLE);*/
				
				break;
			}
		}

	}

	
	private class QueryFightTask extends AsyncTask<String, Void, Void>{

		@Override
		protected void onPreExecute() {
			showProgressDialog("正在加载航班信息...", true);
		}

		@Override
		protected void onPostExecute(Void result) {
			dismissProgressDialog();
		}

		@Override
		protected Void doInBackground(String... params) {
			
			return null;
		}
		
	}
	

}